package com.sh.suhe.utildemos.dialogUtils;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;
import android.widget.LinearLayout;

import com.sh.suhe.utildemos.R;

/**
 * Created by suhe on 2016/9/7.
 */
public class LeftDialog extends Dialog {
    public LeftDialog(Context context) {
        super(context,R.style.dialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_right);
        Window win = this.getWindow();
        win.getAttributes().width = LinearLayout.LayoutParams.WRAP_CONTENT;
        win.getAttributes().gravity = Gravity.LEFT;

//        WindowManager.LayoutParams params = new WindowManager.LayoutParams();
//        params.x = -80;//设置x坐标
//        params.y = -60;//设置y坐标
//        params.width = LinearLayout.LayoutParams.WRAP_CONTENT;
//        params.height = LinearLayout.LayoutParams.MATCH_PARENT;
//        win.setAttributes(params);
    }
}
